<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Pragprog Books Online Store</title>
<!-- START:stylesheet -->
  <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
  <%= javascript_include_tag :defaults %>
<!-- END:stylesheet -->
</head>
<body id="store">
  <div id="banner">
    <!-- START:i18n -->
    <% form_tag '', :method => 'GET', :class => 'locale' do %>
      <%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale),
        :onchange => 'this.form.submit()' %>
      <%= submit_tag 'submit' %>
      <%= javascript_tag "$$('.locale input').each(Element.hide)" %>
    <% end %>
    <!-- END:i18n -->
    <%= @page_title || I18n.t('layout.title') %>
  </div>
  <div id="columns">
    <div id="side">
      <% if @cart %>
      <div id="cart" 
           <% if @cart.items.empty? %>
            style="display: none"
           <% end %>
           >
        <%= render(:partial => "cart", :object => @cart) %>
      </div>
      <% end %>
      <a href="#"><%= t 'layout.side.home' %></a><br />
      <a href="#"><%= t 'layout.side.questions' %></a><br />
      <a href="#"><%= t 'layout.side.news' %></a><br />
      <a href="#"><%= t 'layout.side.contact' %></a><br />
      <% if session[:user_id] %>
      <%= link_to "订购", :controller => 'orders' %><br/>
      <%= link_to "产品", :controller => 'products' %><br/>
      <%= link_to "用户", :controller => 'users' %><br/>
      <%= link_to "注销", :controller => 'admin',:action => "logout" %><br/>
      <% end %>
    </div>
    <div id="main">
      <% if flash[:notice] %>
      <div id="notice"><%= flash[:notice] %></div>
      <% end %>
      <%= yield :layout %><!-- <label id="code.depot.e.include"/> -->
    </div>
  </div>
</body>
</html>
